home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWOSMisc / SLFileOp.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  5.6 KB  |  223 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                SLFileOp.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef SLFILEOP_H
  11. #define SLFILEOP_H
  12.  
  13.  
  14. // ----- OS Includes -----
  15.  
  16. #ifndef FWFILESP_H
  17. #include "FWFileSp.h"
  18. #endif
  19.  
  20. // ----- Foundation Includes -----
  21.  
  22. #ifndef FWEXCDEF_H
  23. #include "FWExcDef.h"
  24. #endif
  25.  
  26. #ifndef FWSTRS_H
  27. #include "FWStrs.h"  
  28. #endif
  29.  
  30. //----- Macintosh includes -----
  31.  
  32. #if defined(FW_BUILD_MAC) && !defined(__TYPES__)
  33. #include <Types.h>
  34. #endif
  35.  
  36. #if defined(FW_BUILD_MAC) && !defined(__FILES__)
  37. #include <Files.h>
  38. #endif
  39.  
  40. #if defined(FW_BUILD_MAC) && !defined(__STANDARDFILE__)
  41. #include <StandardFile.h>
  42. #endif
  43.  
  44. //========================================================================================
  45. // Extern C Methods
  46. //========================================================================================
  47.  
  48. // Export or Import functions for CFM-68K [sfu]
  49.  
  50. #if defined(FW_ODFLIB_IMPORT)
  51. #pragma import on
  52. #elif defined(FW_ODFLIB)
  53. #pragma export on
  54. #endif
  55.  
  56. FW_EXTERN_C_BEGIN
  57.  
  58.  
  59. //========================================================================================
  60. //    struct FW_COpenFileParameters - parameters for StandardGetFile (Mac) and GetOpenFileName (Windows)
  61. //========================================================================================
  62.  
  63. struct FW_SOpenFileParameters;
  64. typedef FW_SOpenFileParameters* FW_HOpenFileParameters;
  65.  
  66. struct FW_SOpenFileParameters
  67. {
  68. #ifdef FW_BUILD_MAC
  69.     short                fNumTypes;
  70.     OSType                fTypes[4];
  71.     FileFilterProcPtr    fFileFilterProc;
  72. #endif
  73.  
  74. #ifdef FW_BUILD_WIN
  75.     HWND                fOwnerWindow;        // [KVV] Windows-specific data type!  Temporary!
  76.     char*                fFilterString;
  77.     char                fDefaultExt[4];
  78. #endif
  79.  
  80.     void*                fReserved;
  81. };
  82.  
  83.  
  84. FW_PlatformError    SL_API
  85. FW_OpenFileParameters_Construct(FW_HOpenFileParameters parameters);
  86.  
  87. FW_PlatformError    SL_API
  88. FW_OpenFileParameters_Destruct(FW_HOpenFileParameters parameters);
  89.  
  90.  
  91. #ifdef FW_BUILD_MAC
  92. FW_PlatformError    SL_API
  93. FW_OpenFileParameters_MacSet(FW_HOpenFileParameters parameters, 
  94.                              short numTypes,
  95.                              OSType* fileType, 
  96.                              FileFilterProcPtr fileFilterProc);
  97.  
  98. short                SL_API
  99. FW_OpenFileParameters_MacCountTypes(FW_HOpenFileParameters parameters);
  100.  
  101. FileFilterProcPtr    SL_API
  102. FW_OpenFileParameters_MacGetFilterProc(FW_HOpenFileParameters parameters);
  103.  
  104. OSType*                SL_API
  105. FW_OpenFileParameters_MacGetTypes(FW_HOpenFileParameters parameters);
  106. #endif
  107.  
  108. #ifdef FW_BUILD_WIN
  109. FW_PlatformError    SL_API
  110. FW_OpenFileParameters_WinInit(FW_HOpenFileParameters parameters, 
  111.                               FW_HString filterString,
  112.                               FW_HString defaultExt,
  113.                               HWND ownerWindow = NULL);
  114.  
  115. FW_PlatformError    SL_API
  116. FW_OpenFileParameters_WinSet(FW_HOpenFileParameters parameters,
  117.                              FW_HString filterString, 
  118.                              FW_HString defaultExt);
  119.  
  120. char*                SL_API
  121. FW_OpenFileParameters_WinGetFilterString(FW_HOpenFileParameters parameters);
  122.  
  123. char*                SL_API
  124. FW_OpenFileParameters_WinGetDefaultExt(FW_HOpenFileParameters parameters);
  125.  
  126. HWND                SL_API
  127. FW_OpenFileParameters_WinGetOwnerWindow(FW_HOpenFileParameters parameters);
  128. #endif
  129.  
  130.  
  131.  
  132. //========================================================================================
  133. //    struct FW_SSaveFileParameters - parameters for StandardPutFile (Mac) and GetSaveFileName (Windows)
  134. //========================================================================================
  135.  
  136. struct FW_SSaveFileParameters;
  137. typedef FW_SSaveFileParameters* FW_HSaveFileParameters;
  138. struct FW_SSaveFileParameters
  139. {
  140. #ifdef FW_BUILD_MAC
  141.     FW_HString            fSavePrompt;
  142.     FW_HString            fDefaultName;
  143. #endif
  144.  
  145. #ifdef FW_BUILD_WIN
  146.     HWND                fOwnerWindow;
  147.     char*                fFilterString;
  148.     char                fDefaultExt[4];
  149.     char*                fDefaultName;
  150. #endif
  151. };
  152.  
  153. FW_PlatformError    SL_API
  154. FW_SaveFileParameters_Construct(FW_HSaveFileParameters parameters);
  155.  
  156. FW_PlatformError    SL_API
  157. FW_SaveFileParameters_Destruct(FW_HSaveFileParameters parameters);
  158.  
  159.  
  160. #ifdef FW_BUILD_MAC
  161. FW_PlatformError    SL_API
  162. FW_SaveFileParameters_MacInit(FW_HSaveFileParameters parameters,
  163.                               FW_HString savePrompt,
  164.                               FW_HString defaultName);
  165.  
  166. FW_HString            SL_API
  167. FW_SaveFileParameters_MacGetSavePrompt(FW_HSaveFileParameters parameters);
  168.  
  169. FW_HString            SL_API
  170. FW_SaveFileParameters_MacGetDefaultName(FW_HSaveFileParameters parameters);
  171. #endif
  172.  
  173. #ifdef FW_BUILD_WIN
  174. FW_PlatformError    SL_API
  175. FW_SaveFileParameters_WinInit(FW_HSaveFileParameters parameters,
  176.                               FW_HString filterString,
  177.                               FW_HString defaultExt,
  178.                               FW_HString defaultName,
  179.                               HWND ownerWindow = NULL);
  180.  
  181. FW_PlatformError    SL_API
  182. FW_SaveFileParameters_WinSet(FW_HSaveFileParameters parameters,
  183.                              FW_HString filterString,
  184.                              FW_HString defaultExt,
  185.                              FW_HString defaultName);
  186.  
  187. char*                SL_API
  188. FW_SaveFileParameters_WinGetFilterString(FW_HSaveFileParameters parameters);
  189.  
  190. char*                SL_API
  191. FW_SaveFileParameters_WinGetDefaultExt(FW_HSaveFileParameters parameters);
  192.  
  193. char*                SL_API
  194. FW_SaveFileParameters_WinGetDefaultName(FW_HSaveFileParameters parameters);
  195.  
  196. HWND                SL_API
  197. FW_SaveFileParameters_WinGetOwnerWindow(FW_HSaveFileParameters parameters);
  198. #endif
  199.  
  200.  
  201. //========================================================================================
  202. //    ChooseFile functions
  203. //========================================================================================
  204.  
  205. FW_OFileSpecification*    SL_API
  206. FW_ChooseFileToOpen(FW_HOpenFileParameters openFileParam);
  207.     
  208. FW_OFileSpecification*    SL_API
  209. FW_ChooseFileToSave(FW_HSaveFileParameters saveFileParam);
  210.  
  211.  
  212. FW_EXTERN_C_END
  213.  
  214. // For CFM-68K [sfu]
  215.  
  216. #if defined(FW_ODFLIB_IMPORT)
  217. #pragma import off
  218. #elif defined(FW_ODFLIB)
  219. #pragma export off
  220. #endif
  221.  
  222. #endif
  223.